<template>
  <div class="loading">
    <img src="./loading.gif" alt="" />
    <div class="title">{{ title }}</div>
  </div>
</template>

<script>
export default {
  name: "Loading",
  props: {
    title: {
      type: String,
      default: "加载中",
    },
  },
};
</script>

<style scoped>
.loading {
  position: fixed;
  width: 20vw;
  height: 20vh;
  z-index: 900;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.loading img {
  height: 100%;
  width: auto;
  object-fit: cover;
}
.loading .title {
  margin-top: 2rem;
  line-height: 2rem;
  font-size: 2rem;
  text-align: center;
  color: #666;
}
</style>